package com.poetry.vup.works.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.poetry.vup.common.entity.works.VupWorksDO;
import com.poetry.vup.works.domain.VupWorksVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WorksExhibitionMapper extends BaseMapper<VupWorksDO> {

    @Select("SELECT * from vup_works ORDER BY gmt_create DESC LIMIT #{offset},#{pageSize}")
    List<VupWorksVO> findAllWorks(@Param("offset") int offset, @Param("pageSize") int pageSize);

    @Select("SELECT count(*) FROM vup_works")
    Long getCount();
}
